/*!
 * saiche
 * Copyright(c) 2020 huangxin <3203317@qq.com>
 * MIT Licensed
 */
'use strict';

const electron = require('electron');
const path = require('path');

const BrowserWindow = electron.BrowserWindow;

const _app = electron.app;
const _dialog = electron.dialog;

let _win = null;

_app.on('ready', () => {

  _win = new BrowserWindow({
    webPreferences: {
      nodeIntegration: true,
      contextIsolation: false,
    },
    show: false,
    frame: true,
  });

  _win.on('closed', function(){
    _win = null;
  });

  _win.once('ready-to-show', () => {
    _win.show();
  });

  // _win.on('resize', () => {
  //   _win.reload();
  // });

  _win.loadFile(path.join(__dirname, './index.html'));
});
